<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<title>{{$web_title}}</title>
<script type="text/javascript">
    function outExcel() {
        var ppid_arr = document.getElementsByName('ppid[]');
        //数组格式
        var id_arr = document.getElementsByName('id[]');
        var deliverNumber_arr = document.getElementsByName('deliverNumber[]');
        var deliverWeight_arr = document.getElementsByName('deliverWeight[]');
        var deliverFee_arr = document.getElementsByName('deliverFee[]');
        var fee_arr = document.getElementsByName('fee[]');
        var orderId_arr = document.getElementsByName('orderId[]');
        var weight_arr = document.getElementsByName('weight[]');

        //拼接字符
        var id_str = "";
        var deliverNumber_str = "";
        var deliverWeight_str = "";
        var deliverFee_str = "";
        var fee_str = "";
        var orderId_str = "";
        var weight_str = "";

        for(var i = 0; i < ppid_arr.length; i++)
        {
            if(ppid_arr[i].checked == true)
            {
               if(i>0){
                   id_str = id_str+","+id_arr[i].value;
                   deliverNumber_str = deliverNumber_str+","+deliverNumber_arr[i].value;
                   deliverWeight_str = deliverWeight_str+","+deliverWeight_arr[i].value;
                   deliverFee_str = deliverFee_str+","+deliverFee_arr[i].value;
                   fee_str = fee_str+","+fee_arr[i].value;
                   orderId_str = orderId_str+","+orderId_arr[i].value;
                   weight_str = weight_str+","+weight_arr[i].value;
               }else{
                   id_str = id_str+id_arr[i].value;
                   deliverNumber_str = deliverNumber_str+deliverNumber_arr[i].value;
                   deliverWeight_str = deliverWeight_str+deliverWeight_arr[i].value;
                   deliverFee_str = deliverFee_str+deliverFee_arr[i].value;
                   fee_str = fee_str+fee_arr[i].value;
                   orderId_str = orderId_str+orderId_arr[i].value;
                   weight_str = weight_str+weight_arr[i].value;
               }

            }
        }
        $("#id_str").val(id_str);
        $("#deliverNumber_str").val(deliverNumber_str);
        $("#deliverWeight_str").val(deliverWeight_str);
        $("#deliverFee_str").val(deliverFee_str);
        $("#fee_str").val(fee_str);
        $("#orderId_str").val(orderId_str);
        $("#weight_str").val(weight_str);
        //alert(ppid_arr.length);return ;
        $("#deliverForm").submit();

    }
</script>
<body class="withvernav">
<div class="bodywrapper">
    {{include file='/public/leftmenu.tpl'}}
    <div class="centercontent tables">
        <div class="pageheader notab">
            <h1 class="pagetitle">{{$web_title}}</h1>
            <span class="pagedesc"></span>
        </div>
        <!--pageheader-->
        <form method="post" action="/ExpPrice/doBillWithExpress" name="deliverForm" id="deliverForm">
            <div class="page">
                <a onClick="outExcel('ppid[]')">导出excel</a>
                <input type="hidden" value="" name="id_str" id="id_str">
                <input type="hidden" value="" name="deliverNumber_str" id="deliverNumber_str">
                <input type="hidden" value="" name="deliverWeight_str" id="deliverWeight_str">
                <input type="hidden" value="" name="deliverFee_str" id="deliverFee_str">
                <input type="hidden" value="" name="fee_str" id="fee_str">
                <input type="hidden" value="" name="orderId_str" id="orderId_str">
                <input type="hidden" value="" name="weight_str" id="weight_str">
                <input type="hidden" name="outExcel" value="outExcel">
            </div>
            <!--
            <div class="page">
                <input type="hidden" name="outExcel" value="outExcel">
                <button type="submit" value="导出excel">导出excel</button>
            </div>
            -->
        <div id="contentwrapper" class="contentwrapper">
            <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
                <thead>
                <tr>
                   <th><a onClick="allSelect('ppid[]')">全选</a></th>
                    <th class="head1">EXCEL&nbsp;行号</th>
                    <th class="head1">运单号</th>
                    <th class="head1">重量</th>
                    <th class="head0">资费</th>
                    <th class="head0">复漫预计运费</th>
                    <th class="head1">复漫订单号</th>
                    <th class="head1">复漫实际称重重量</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td colspan="4"></td>
                    <td style="color:red;">总计：{{$total_money}},复漫有运单号费用：{{$chajia_money}}<input type="hidden" name="total_money" value="{{$total_money}}"><input type="hidden" name="chajia_money" value="{{$chajia_money}}"></td>
                    <td style="color:red;">总计：{{$fuman_money}}<input type="hidden" name="fuman_money" value="{{$fuman_money}}"></td>
                    <td colspan="3"></td>
                </tr>
                {{foreach from=$chargeslist item=li key=key}}
                    <tr>
                        <td><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.id}}" /></td>
                        <td>{{$li.id}}<input type="hidden" name="id[]" value="{{$li.id}}"></td>
                        <td>{{$li.deliverNumber}}<input type="hidden" name="deliverNumber[]" value="{{$li.deliverNumber}}"></td>
                        <td>
                            {{if $li.deliverWeight eq $li.weight}}
                                {{$li.deliverWeight}}
                            {{else}}
                                <span style="color:red;">{{$li.deliverWeight}}</span>
                            {{/if}}
                            <input type="hidden" name="deliverWeight[]" value="{{$li.deliverWeight}}">
                        </td>
                        <td>{{$li.deliverFee}}<input type="hidden" name="deliverFee[]" value="{{$li.deliverFee}}"></td>
                        <td>{{$li.fee}}<input type="hidden" name="fee[]" value="{{$li.fee}}"></td>
                        <td><a href="/orderlist/orderlist?kw={{{{$li.orderId}}}}">{{$li.orderId}}<input type="hidden" name="orderId[]" value="{{$li.orderId}}"></a></td>
                        <td>
                            {{if $li.deliverWeight eq $li.weight}}
                                {{$li.weight}}
                            {{else}}
                                <span style="color:red;">{{$li.weight}}</span>
                            {{/if}}
                            <input type="hidden" name="weight[]" value="{{$li.weight}}">
                        </td>
                    </tr>
                {{/foreach}}
                <tr>
                    <td colspan="4"></td>
                    <td style="color:red;">总计：{{$total_money}},复漫有运单号费用：{{$chajia_money}}</td>
                    <td style="color:red;">总计：{{$fuman_money}}</td>
                    <td colspan="3"></td>
                </tr>
                </tbody>

            </table>
        </form>
            <br />
            <br />
        </div>
    </div>
    <!--bodywrapper-->
</body>
</html>